<div class="card">
	{{ include("@Grid/search.html.twig", {'searchField':searchField}) }}
				{% if gridBar %}
	<div class="card-header">
		<div class="card-title">
				{% for gk, gv in gridBar %}
					{% if gv['draftType'] !=0 %}
		<div class="btn-group">
						{% if if_set(gv,'newTab', 0) !=0 %}
							{% if gv['type'] == 'button' %}
								<button type="button" data-url="{{ gv['url'] }}"  class="btn btn-sm btn-primary newTab {{ gv['class'] }}" title="{{ gk }}">
									<i class="{{ gv['iconCLass'] }}"></i>
									<span class="hidden-xs">{{ gk }}</span>
								</button>
							{% endif %}
						{% else %}
							{% if gv['type'] == 'button' %}
								<a type="button" href="{{ gv['url'] }}" class="btn btn-sm btn-primary {{ gv['class'] }}" title="{{ gk }}" {% if gv['isBlank'] %} target="_blank" {% endif %}>
									<i class="{{ gv['iconCLass'] }}"></i>
									<span class="hidden-xs">{{ gk }}</span>
								</a>
							{% endif %}
						{% endif %}
							<button type="button" class="btn btn-sm btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
							<span class="sr-only">切换下拉列表</span>
							</button>
							<ul class="dropdown-menu" style="">
								<li>
									<a class="dropdown-item newTab" href="javascript:;" data-url="{{ path('admin_draft_list', {'type':gv['draftType']}) }}" title="草稿" title="草稿">							<i class="mdi mdi-recycle"></i>
										<span class="hidden-xs">草稿</span>
									</a>
								</li>
							</ul>
		</div>
					{% else %}
						{% if if_set(gv,'newTab', 0) !=0 %}
							{% if gv['type'] == 'button' %}
								<a data-url="{{ gv['url'] }}" href="javascript:;" class="btn btn-sm btn-primary newTab {{ gv['class'] }}" title="{{ gk }}">
									<i class="{{ gv['iconCLass'] }}"></i>
									<span class="hidden-xs">{{ gk }}</span>
								</a>
							{% endif %}
						{% else %}
							{% if gv['type'] == 'button' %}
								<a href="{{ gv['url'] }}" class="btn btn-sm btn-primary {{ gv['class'] }}" title="{{ gk }}" {% if gv['isBlank'] %} target="_blank" {% endif %}>
									<i class="{{ gv['iconCLass'] }}"></i>
									<span class="hidden-xs">{{ gk }}</span>
								</a>
							{% endif %}
						{% endif %}
					{% endif %}

				{% endfor %}
		</div>
	</div>
		{% endif %}
	<div class="card-body table-responsive .p-0">
		<table class="table table-hover text-nowrap">
			<thead>
				<tr>
					{% for cv in column %}
						{% if cv['type'] == 'id' %}
							<th align="left">
								<div class="custom-control custom-checkbox">
									<input type="checkbox" class="custom-control-input" id="choose-all" name="choose-all">
									<label class="custom-control-label" for="choose-all"></label>
								</div>
							</th>
						{% endif %}
					{% endfor %}
					{% for k, v in column %}
						<th align="left">
							{% if v['sort'] %}
								{{  knp_pagination_sortable(pagination, k, v['sort']) }}
							{% else %}
								{{  k }}
							{% endif %}
						</th>
					{% endfor %}
					{% if tableActionCallback %}
						<th>操作</th>
					{% endif %}
				</tr>
			</thead>
			<tbody>
				{% for v in list %}
					<tr>
						{% for cv in column %}
							{% if cv['type'] == 'id' %}
								<td align="left">
									{% if array_get(v, 'isLock') %}
										{% else %}
											<div class="custom-control custom-checkbox">
												<input type="checkbox" class="custom-control-input" id="chb{{ get_prop(v, cv["field"], cv['type'], cv['options'])|raw }}" name="ids[]" value="{{ get_prop(v, cv["field"], cv['type'], cv['options'])|raw }}">
												<label class="custom-control-label" for="chb{{ get_prop(v, cv["field"], cv['type'], cv['options'])|raw }}"></label>
											</div>
									{% endif %}
								</td>
							{% endif %}
						{% endfor %}
						{% for cv in column %}
							<td align="left">
								{% if cv['type'] == 'text' or cv['type'] == 'datetime' or cv['type'] == 'textarea' %}
									{{ get_prop(v, cv["field"], cv['type'], cv['options'])|raw }}
								{% endif %}

								{% if cv['type'] == 'badgePrimary' %}
									<span class="badge badge-primary">{{ get_prop(v, cv["field"], cv['type'], cv['options'])|raw }}</span>
								{% endif %}

								{% if cv['type'] == 'badgeSuccess' %}
									<span class="badge badge-success">{{ get_prop(v, cv["field"], cv['type'], cv['options'])|raw }}</span>
								{% endif %}


								{% if cv['type'] == 'badgeInfo' %}
									<span class="badge badge-info">{{ get_prop(v, cv["field"], cv['type'], cv['options'])|raw }}</span>
								{% endif %}

								{% if cv['type'] == 'badgeWarning' %}
									<span class="badge badge-warning">{{ get_prop(v, cv["field"], cv['type'], cv['options'])|raw }}</span>
								{% endif %}

								{% if cv['type'] == 'badgeDanger' %}
									<span class="badge badge-danger">{{ get_prop(v, cv["field"], cv['type'], cv['options'])|raw }}</span>
								{% endif %}

								{% if cv['type'] == 'badgeDark' %}
									<span class="badge badge-dark">{{ get_prop(v, cv["field"], cv['type'], cv['options'])|raw }}</span>
								{% endif %}

								{% if cv['type'] == 'badgePurple' %}
									<span class="badge badge-purple">{{ get_prop(v, cv["field"], cv['type'], cv['options'])|raw }}</span>
								{% endif %}

								{% if cv['type'] == 'badgePink' %}
									<span class="badge badge-pink">{{ get_prop(v, cv["field"], cv['type'], cv['options'])|raw }}</span>
								{% endif %}

								{% if cv['type'] == 'badgeBrown' %}
									<span class="badge badge-brown">{{ get_prop(v, cv["field"], cv['type'], cv['options'])|raw }}</span>
								{% endif %}

								{% if cv['type'] == 'badgeMuted' %}
									<span class="badge badge-muted">{{ get_prop(v, cv["field"], cv['type'], cv['options'])|raw }}</span>
								{% endif %}

								{% if cv['type'] == 'tip' %}
									<a title='{{ get_prop(v, cv["field"], cv['type'], cv['options'])|raw }}' class="msgtip" style="color:#e83e8c">
										{{ get_prop(v, cv["field"], cv['type'], cv['options'])|raw|striptags|substr(0, 20)}}
									</a>
								{% endif %}

								{% if cv['type'] == 'json' %}
									{{ get_prop(v, cv["field"], cv['type'], cv['options'])|json_encode }}
								{% endif %}

								{% if cv['type'] == 'code' %}
									<div class='overflow-auto' style='width:300px'>
										<code class="clipboard" data-clipboard-text="{{ get_prop(v, cv["field"], cv['type'], cv['options']) }}">{{ get_prop(v, cv["field"], cv['type'], cv['options'])|raw }}</code>
									</div>
								{% endif %}
								{% if cv['type'] == 'image'  %}
									{% if get_prop(v, cv['field'], cv['type'], cv['options']) %}
										<img src="{{ get_prop(v, cv["field"], cv['type'], cv['options'])|raw }}" class="imgpreview" width="30px"/>
									{% endif %}
								{% endif %}
								{% if cv['type'] == 'boole' %}
									{% if get_prop(v, cv['field'], cv['type']) %}
										<span class="badge bg-success">Y</span>
									{% else %}
										<span class="badge bg-danger">N</span>
									{% endif %}
								{% endif %}
								{% if cv['type'] == 'boole2' %}
									{% if cv['actionCall'] %}
										{{ get_prop(cv['actionCall'],v)|raw }}
									{% else %}
										{% if get_prop(v, cv['field'], cv['type']) %}
											<span class="badge bg-success">Y</span>
										{% else %}
											<span class="badge bg-danger">N</span>
										{% endif %}
									{% endif %}
								{% endif %}
							</td>
						{% endfor %}
						{% if tableActionCallback %}
							<td align="left">
								{% for tb in  tableActionCallback %}
									{{ get_prop(tb, v)|raw }}
								{% endfor %}
							</td>
						{% endif %}
					</tr>
				{% else %}
					<tr>
						<td colspan="{{ sum(column|length, 1) }}" align="left">暂无数据</td>
						<td></td>
					</tr>
				{% endfor %}
			</tbody>
		</table>
	</div>
	<div class="navigation row" style="margin-bottom: 10px;padding-left: 30px;">
		{% if(bathDelete) %}
			<div class="col-1">
				<a href='javascript:;' data-href="{{ bathDelete|raw }}" data-confirm="确认要删除选择的行吗?" title="删除" class="btn btn-danger btn-xs ajaxBathDelete">
					<i class="mdi mdi-delete"></i>
				</a>
			</div>
		{% endif %}
		<div class="col-11">
			{{ knp_pagination_render(pagination) }}
		</div>
	</div>
</div>
